package com.berchen.数据结构.栈;

public class ArrayStackTest {
    public static void main(String[] args){

        ArrayStack stack=new ArrayStack(5);
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);

        stack.list();
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());

        System.out.println("链表实现栈");
        LinketStack linketStack=new LinketStack();
        linketStack.push(new Node(1));
        linketStack.push(new Node(2));
        linketStack.push(new Node(3));

        linketStack.list();

        System.out.println("先进后出");
        System.out.println(linketStack.pop());
    }
}
